//
//  PartRecordViewCell.m
//  MerieuxWskProj
//
//  Created by 郭同博 on 16/8/12.
//  Copyright © 2016年 visionet. All rights reserved.
//

#import "PartRecordViewCell.h"
#import "PartRecordMessage.h"
#import "DevicePrepaireReportViewController.h"
@implementation PartRecordViewCell
@synthesize partNum;
@synthesize partName;
@synthesize badPartEqse;
@synthesize count;
@synthesize indexPath;
@synthesize parentController;
@synthesize tableV;
+(instancetype)PartRecordCellWithTableView:(UITableView *)tableView{
    static NSString *cellID = @"PartRecordCell";
    PartRecordViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"PartRecordViewCell" owner:nil options:nil] lastObject];
    }
    
    return cell;
    
}
- (IBAction)add {
    
    if (indexPath.section == 6) {
        PartRecordMessage *arr= [[PartRecordMessage alloc]init];
        [parentController.badPartModArr addObject:arr];
        NSLog(@" add   = =====%lu",parentController.badPartModArr.count);
        [tableV reloadData];
    }
}
- (IBAction)del {
    if (indexPath.section == 6) {
        self.delBtn.hidden = NO;
        [parentController.badPartModArr removeObjectAtIndex:self.indexPath.row-1];
        NSLog(@" add   = =====%lu",self.parentController.badPartModArr.count);
        
        [tableV reloadData];
    }

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
